﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data;
using MySql.Data.MySqlClient;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            TempSt.myconn.Open();
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            TempSt.mystr = "select * from account where user= '" + textBox1.Text + "'";
            
            TempSt.myreader.Read();
            //String text = mycmd.ExecuteScalar().ToString();
            try {
                if (textBox2.Text == TempSt.myreader[1].ToString())
            {
                Form2 Form2 = new Form2();

                Form2.Show();
                this.Hide();

            }
            else
                MessageBox.Show("xuancuole", "cuowu", MessageBoxButtons.OK); 

            }
            catch(Exception err)
            {
                MessageBox.Show("yonghumingcuowu", "cuowu", MessageBoxButtons.OK);
            }
        }

    }
}
